<%@page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=1">
    <link rel="stylesheet" type="text/css" href="${gPath}/styles/dingtalk/style/pc.css"/>
    <style type="text/css">
        *{ margin: 0; padding: 0; }
        .header-wrap{ width: 100%; border-bottom: 2px solid #e6e5e6;}
        .header-bd{ width: 100%; height: 30px; margin: 0 auto; padding: 4px 3px 4px 3px; background-color: #ffffff; line-height: 30px; font-size: small;}
        .fixed{ position: fixed; width: 100%; z-index: 1000; border-bottom: 2px solid #e6e5e6;}
    </style>
    <%--<%@ include file="/view/dingtalk/pc/jsapi-header.jsp" %>--%>
    <script type="text/javascript" src="${gPath}/scripts/jquery/jquery-1.8.1.min.js"></script>
    <script type="text/javascript">
        window.onload=function(){
            function adsorption(){
                var headerWrap=document.getElementById('header-wrap');
                var scrollTop=0;
                window.onscroll=function(){
                    scrollTop=document.body.scrollTop||document.documentElement.scrollTop;
                    if(scrollTop>100){
                        headerWrap.className='fixed';
                    }else{
                        headerWrap.className='header-wrap';
                    }
                }
            }
            adsorption();
        }
        //用浏览器打开页面，暂时不能实现，需要记住登录状态。
        /*DingTalkPC.ready(function() {
            $(function(){
                $("a").click(function(event){
                    event.preventDefault();
                    DingTalkPC.biz.util.openLink({
                        url: this.href,//要打开链接的地址
                        onSuccess : function(result) {
                        }
                    });
                });
            });
        });*/
    </script>
</head>
<body>
<div id="header-wrap" class="header-wrap">
    <div class="header-bd">
        <span style="float: right; padding-right: 5px;">
            <shiro:user>
                当前用户：【<span style="color: #4d78ff;"><shiro:principal property="name"/></span>】
            </shiro:user>
        </span>
    </div>
</div>
<ul class="aa">
    <c:choose>
        <c:when test="${fn:length(menus)>0}">
            <c:forEach var="menu" items="${menus}">
                <li class="m"><a href="${gPath}${menu.url}"><img src="${gPath}/styles/dingtalk/image${menu.pic}"><p>${menu.name}</p></a></li>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <h1>您还没有配置菜单</h1>
        </c:otherwise>
    </c:choose>
</ul>
</body>
</html>